import request from '@/utils/request'

/**
 * 获取权限组列表
 */
export const getPermissionListAPI = (params) => {
  return request({
    method: 'get',
    url: '/permissions',
    params
  })
}

/**
 * 新增权限组
 */

export const addPermissionAPI = (data) => {
  return request({
    method: 'post',
    url: '/permissions',
    data
  })
}

/**
 * 获取权限组详情
 */
export const getPerDetailAPI = (id) => {
  return request({
    method: 'get',
    url: `/permissions/${id}`,
    params: {
      id
    }
  })
}

/**
 * 权限修改
 */
export const putPermissionAPI = (data) => {
  return request({
    method: 'put',
    url: `/permissions/${data.id}`,
    data
  })
}

/**
 * 权限删除
 */
export const delPermissionAPI = (id) => {
  return request({
    method: 'delete',
    url: `/permissions/${id}`
  })
}
